import Taro from "@tarojs/taro";

export const setStorage = (key, data) => {
  Taro.setStorage({
    key,
    data,
    fail: (res) => {
      console.log(res);
    },
  });
};

export const getStorage = (key) => {
  try {
    return Taro.getStorageSync(key);
  } catch (e) {
    console.log(e);
  }
};

export const removeStorage = (key) => {
  Taro.removeStorage({ key });
};
